import*as t from"../../../third_party/codemirror.next/codemirror.next.js";const e=new CSSStyleSheet;e.replaceSync(".token-variable{color:var(--color-token-variable)}.token-property{color:var(--color-token-property)}.token-type{color:var(--color-token-type)}.token-variable-special{color:var(--color-token-variable-special)}.token-definition{color:var(--color-token-definition)}.token-builtin{color:var(--color-token-builtin)}.token-number{color:var(--color-token-number)}.token-string{color:var(--color-token-string)}.token-string-special{color:var(--color-token-string-special)}.token-atom{color:var(--color-token-atom)}.token-keyword{color:var(--color-token-keyword)}.token-comment{color:var(--color-token-comment)}.token-meta{color:var(--color-token-meta)}.token-invalid{color:var(--color-error-text)}.token-tag{color:var(--color-token-tag)}.token-attribute{color:var(--color-token-attribute)}.token-attribute-value{color:var(--color-token-attribute-value)}.token-inserted{color:var(--color-token-inserted)}.token-deleted{color:var(--color-token-deleted)}.token-heading{color:var(--color-token-variable-special);font-weight:bold}.token-link{color:var(--color-token-variable-special);text-decoration:underline}.token-strikethrough{text-decoration:strike-through}.token-strong{font-weight:bold}.token-emphasis{font-style:italic}\n/*# sourceURL=codeHighlighter.css */\n");var a=Object.freeze({__proto__:null,default:e});const r=t.tags,o=t.HighlightStyle.define([{tag:r.variableName,class:"token-variable"},{tag:r.definition(r.variableName),class:"token-definition"},{tag:r.propertyName,class:"token-property"},{tag:[r.typeName,r.className,r.namespace,r.macroName],class:"token-type"},{tag:[r.special(r.name),r.constant(r.className)],class:"token-variable-special"},{tag:r.standard(r.variableName),class:"token-builtin"},{tag:[r.number,r.literal,r.unit],class:"token-number"},{tag:r.string,class:"token-string"},{tag:[r.special(r.string),r.regexp,r.escape],class:"token-string-special"},{tag:[r.atom,r.labelName,r.bool],class:"token-atom"},{tag:r.keyword,class:"token-keyword"},{tag:[r.comment,r.quote],class:"token-comment"},{tag:r.meta,class:"token-meta"},{tag:r.invalid,class:"token-invalid"},{tag:r.tagName,class:"token-tag"},{tag:r.attributeName,class:"token-attribute"},{tag:r.attributeValue,class:"token-attribute-value"},{tag:r.inserted,class:"token-inserted"},{tag:r.deleted,class:"token-deleted"},{tag:r.heading,class:"token-heading"},{tag:r.link,class:"token-link"},{tag:r.strikethrough,class:"token-strikethrough"},{tag:r.strong,class:"token-strong"},{tag:r.emphasis,class:"token-emphasis"}]);async function s(e,a){const r=await n(a);let o;return o=r?r.language.parser.parse(e):new t.Tree(t.NodeType.none,[],[],e.length),new c(e,o)}async function n(e){switch(e){case"application/javascript":case"application/ecmascript":case"application/x-ecmascript":case"application/x-javascript":case"text/ecmascript":case"text/javascript1.0":case"text/javascript1.1":case"text/javascript1.2":case"text/javascript1.3":case"text/javascript1.4":case"text/javascript1.5":case"text/jscript":case"text/livescript ":case"text/x-ecmascript":case"text/x-javascript":case"text/javascript":case"text/jsx":return t.javascript.javascript({jsx:!0});case"text/typescript":return t.javascript.javascript({typescript:!0});case"text/typescript-jsx":return t.javascript.javascript({typescript:!0,jsx:!0});case"text/css":return t.css.css();case"text/html":return t.html.html({selfClosingTags:!0});case"application/xml":case"image/svg+xml":return(await t.xml()).xml();case"application/wasm":return(await t.wast()).wast();case"text/x-c++src":return(await t.cpp()).cpp();case"text/x-go":return new t.LanguageSupport(await t.go());case"text/x-java":return(await t.java()).java();case"text/x-kotlin":return new t.LanguageSupport(await t.kotlin());case"application/json":case"application/manifest+json":return(await t.json()).json();case"application/x-httpd-php":return(await t.php()).php();case"text/x-python":return(await t.python()).python();case"text/markdown":return(await t.markdown()).markdown();case"text/x-sh":return new t.LanguageSupport(await t.shell());case"text/x-coffeescript":return new t.LanguageSupport(await t.coffeescript());case"text/x-clojure":return new t.LanguageSupport(await t.clojure());case"application/vnd.dart":return new t.LanguageSupport(await t.dart());case"text/x-gss":return new t.LanguageSupport(await t.gss());case"text/x-less":return(await t.less()).less();case"text/x-sass":return(await t.sass()).sass({indented:!0});case"text/x-scala":return new t.LanguageSupport(await t.scala());case"text/x-scss":return(await t.sass()).sass({indented:!1});case"text/x.angular":return(await t.angular()).angular();case"text/x.svelte":return(await t.svelte()).svelte();case"text/x.vue":return(await t.vue()).vue();default:return null}}class c{code;tree;constructor(t,e){this.code=t,this.tree=e}highlight(t){this.highlightRange(0,this.code.length,t)}highlightRange(e,a,r){let s=e;const n=(t,e)=>{t>s&&(r(this.code.slice(s,t),e),s=t)};t.highlightTree(this.tree,o,((t,e,a)=>{n(t,""),n(e,a)}),e,a),n(a,"")}}var i=Object.freeze({__proto__:null,highlightStyle:o,create:s,highlightNode:async function(t,e){const a=t.textContent||"",r=await s(a,e);t.removeChildren(),r.highlight(((e,a)=>{let r=document.createTextNode(e);if(a){const t=document.createElement("span");t.className=a,t.appendChild(r),r=t}t.appendChild(r)}))},languageFromMIME:n,CodeHighlighter:c});export{i as CodeHighlighter,a as Style};
